<template>
  <v-chart
      :option="option"
      style="width: 100%; height: 400px"
  />
</template>

<script setup>
import { ref } from 'vue';
import VChart from 'vue-echarts';
import { use } from 'echarts/core';
import { LineChart } from 'echarts/charts';
import { GridComponent, TooltipComponent } from 'echarts/components';
import { CanvasRenderer } from 'echarts/renderers';
import { useRoute } from 'vue-router'


// 路由实例
const router = useRoute();
console.error("params:",router.params)
console.error("query:",router.query)
// 注册所需组件
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer]);

const option = ref({
  xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] },
  yAxis: { type: 'value' },
  series: [{ data: [120, 200, 150], type: 'line' }]
});
</script>

<!-- 安装：npm install echarts vue-echarts -->